from LatePenalty.gradescope import gradescope_grade
gradescope late penalty tutorial
Authentication & Initialization
To use the canvas API functionalities, you will have to provide API credentials in order to communicate to canvas. For more details, visit how to set credentials
Be sure to provide with the correct course_id
and assignment_id
of your target assignment to the gradescope_grade
object. You can also double check in the output message of whether you have provided the correct credentials, course, and assignment to the object.
= gradescope_grade("../../../credentials.json",
grade =45059,
course_id=641795,
assignment_id="../data/gradescope_example.csv",
gradescope_fp=1,
verbosity )
Authorization Successful!
Course Set: COGS 118A - Supvr/Mach Learning Algorithms - Fleischer [SP23]
Getting List of Users... This might take a while...
Users Fetch Complete! The course has 169 users.
Assignment A1 Link!
The gradescope generated csv file will look something like the following. For each assignment, the score and lateness are recorded. We can use those information to calculate the late day balance and to apply appropriate late penalties to student.
Understand the Gradescope Export csv File
# take a look at the csv file
grade.gradescope
First Name | Last Name | SID | Assignment 1 | Assignment 1 - Manual Grading | Assignment 1 - Lateness (H:M:S) | |
---|---|---|---|---|---|---|
kkdwdx | FVPqOMpv | jhjx | zPBPCJwDL | 0.650 | 1.8 | 24:01:41 |
JhThhnUaOPDUIEb | BVTLaj | JL | bJhgVCFRz | 0.900 | 2.1 | 00:00:00 |
dbAbqg | uaNTaJHacrK | PNrEkH | DqEMLsESM | 0.475 | 1.9 | 00:00:00 |
From the table, we will be only interested in the target assignment Assignment 1
, and the Lateness of each student’s submission, found in the column Assignment 1 - Lateness (H:M:S)
.
Sometime, an assignment might have multiple components. For example, in COGS 118A, we have a mixture of autograded jupyter notebook and a manual grading component for each assignment. This package will post the summation of score between the components, and use the target_assignment
to calculate late penalty.
Post Grade
Before each post grade, it is nice to do a sanity check before posting to canvas. You can achieve that by specifying post=False
in the gradescope_grade.post_to_canvas
grade.post_to_canvas(="Assignment 1",
target_assignment=[],
passed_assignments=["Assignment 1", "Assignment 1 - Manual Grading"],
components=False
post )
Force Posting Disabled. If you need to completely overwrite student scores, please set force=True
Post Disabled
The message is:
Assignment 1:
Late Submission: 25 Hours Late
Slip Credit Used. No late penalty applied
Remaining Slip Credit: 95 Hours
Post Disabled
The message is:
Assignment 1:
Submitted intime
Remaining Slip Credit: 120 Hours
Post Disabled
The message is:
Assignment 1:
Submitted intime
Remaining Slip Credit: 120 Hours